import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      // http://localhost:5173/
      path: '/',
      name: 'home',
      component: ()=> import('../views/Home.vue'),
      // 子路由
      children:[
         // http://localhost:5173/user
        {
          path:'/user',
          name: 'user',
          component: ()=> import('../views/user/index.vue'),
        },
        // http://localhost:5173/role
        {
          path:'/role',
          name: 'role',
          component: ()=> import('../views/role/index.vue'),
        }

      ]
    },
    // http://localhost:5173/login
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue'),
    },
  ],
})

export default router
